using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace layerdemo.Controllers
{
    public class HomeController : Controller
    {
        /// <summary>
        /// 项目启动主页--12134567
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
           //定义学生的model对象，并生成一个student类

            Student student = new Student();
            student.Name = "张三";
            student.Age = 20;
            student.Gender = "男";
            student.Grade = 3;
            student.Address = "北京市";

            //将学生的model对象传递给视图
            ViewData["Student"] = student;

           // var students = dbContext.Students.AsQueryAble();
           

            return View();
        }

        public ActionResult Main()
        {
            return View();
        }

        public ActionResult About(int id=9)
        {
            ViewBag.Id = id;

            return View();
        }
    }

    public class Student
    {
        public string Name { get; set; }
        public int Age { get; set; }
        public string Gender { get; set; }      
        public int Grade { get; set; }
        public string Address { get; set; }
    }
}